package com.situ.stmall.service.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.situ.stmall.mapper.PicMapper;
import com.situ.stmall.service.PicService;

@Service
public class PicServiceImpl implements PicService{

	@Autowired
	private PicMapper picMapper;
	
	@Override
	public List<String> getAll() {
		
		List<Map<String, String>> picList = picMapper.selectAll();
		List<String> pics = new ArrayList<>();
		
		for (Map<String, String> pic: picList) {
			if (pic != null) {
				pics.add(pic.get("name"));
			}
		}
		
		return pics;
	}

}
